The properties of the measured objects in 3D profile using the grating projection are more and more complex, there are a large number of splits in the extracted refinement grating stripes, and the refinement stripe encoding is very difficult. An automatic coding algorithm based on color structure light was proposed. The paper designed a new model of color structure light, introduced its design principle and implemented a new automatic stripe coding algorithm. First, the algorithm extracted the refinement grating stripe with color information from the color structure grating. Then, orderly encoded the refined stripes of each color by judging the best connected domain. Finally, the article got the stripe coding of the total image through combined coding by using the periodicity of grating model. The simulation experiment results show that the model design of color structure light is simple, the automatic coding algorithm of stripe has high accuracy and the error is decreased to 10 percent. The ideal 3D points cloud data model can be reconstructed through the strip coded data.
The cluster number is not generally set by K-means clustering algorithm beforehand, and artificial initial clustering number easily leads to the problem of unstable clustering results. A high-efficient algorithm for determining the K-means optimal clustering number was presented. The algorithm got the upper bound of the number of clustering search range through stratified sample data and designed a new kind of effective clustering indicator to evaluate the clustering degree of similarity between and within class after clustering. Thus the optimal number of clusters was obtained in the search range of the clusters number. The simulation results show that the algorithm can obtain the optimal clustering number fast and accurately, and the dataset clustering effect is good.